/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jas.bank;

import http.rpc.RemoteException;
import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author Asger
 */
public class BankImpl implements Bank {
    
    private Map<String, Account> accounts = new HashMap<String, Account>();

    public Account getAccount(String name) throws RemoteException {
        Account a = accounts.get(name);
        if (a == null) {
            a = new AccountImpl(name);
            accounts.put(name, a);
        }
        return a;
    }

}
